<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>查询个人用户分润明细</title>
		<link rel="stylesheet" href="css/lib/bootstrap.min.css"/>
		<script src="js/lib/jquery-1.11.0.js"></script>
		<script src="js/lib/bootstrap.min.js"></script>
		<script src="js/lib/angular.min.js"></script>
		<script src="js/base.js" type="text/javascript" charset="utf-8"></script>
	</head>
	 <style>
	 	body{
	 		font-size:12px;
	 	}
	 	table,
		th,
		td {
			border: 1px solid grey;
			border-collapse: collapse;
			padding: 5px;
			vertical-align: middle !important;
		}		
		table td:nth-child(even) {
			
		}
		table tr:nth-child(2) {
			background-color:#f1f1f1;
		}
		input{
			width:280px;
		}
		span{
			width:20px;color:red;display:inline-block;text-align:center;
		}
		#sho{
			width:300px;
			height:50px;
			background:#d9534f;
			opacity:0.8;
			border-radius:8px;
			color:#fff;
			text-align: center;
			font-size:30px;
			position: absolute;
			top:0px;
			left:550px;
			display:none;
		}
	 </style>
	<body ng-app="myApp" ng-controller="customersCtrl">
		<div class="">
			<div id="sho" ng-show="kk"></div>
		<!--获取所有用户分润明细-->
			<div style="padding:15px 5px 0px 5px;border:3px solid #ccc;margin-bottom:15px">
			<table class="table table-hover">
				
				<tbody>
					<tr>
						<th colspan="11">获取用户分润明细：</th>
					</tr>
					<tr>
						<td class="text-center">序号</td>
						<td class="text-center">订单号</td>
						<td class="text-center">订单ID</td>
						<td class="text-center">发起人</td>
						<td class="text-center">发起金额</td>
						<td class="text-center">发起费率</td>
						<td class="text-center">获取ID</td>
						<td class="text-center">获取人手机号</td>
						<td class="text-center">获取人费率</td>
						<td class="text-center">获取分润金额</td>
						<td class="text-center">日期时间</td>
						
					</tr>
					<tr id="show" ng-repeat="item in items">
						<td class="text-center" id="show1">{{$index+1}}</td>
						<td class="text-center">{{item.ordercode}}</td>
						<td class="text-center" id="show2">{{item.id}}</td>
						<td class="text-center" id="show3">{{item.oriphone}}</td>
						<td class="text-center" id="show4">{{item.amount | currency:"￥ "}}</td>
						<td class="text-center" id="show5">{{item.orirate}}%</td>
						<td class="text-center" id="show6">{{item.oriuserid}}</td>
						<td class="text-center" class="show7">{{item.acqphone}}</td>
						<td class="text-center" id="show8">{{item.acqrate}}%</td>
						<td class="text-center" id="show9">{{item.acqAmount | currency:"￥ "}}</td>
						<td class="text-center" id="show10">{{item.createTime}}</td>
					</tr>
					<tr>
						<td colspan="11" id="show01" class="text-center">
							总共{{pages}}条数据
						</td>
					</tr>
				</tbody>
			</table>		
		</div>
		</div>
	</body>
	<script>
		$(function(){
			$('input0').focus()
			$('input1').focus()
		})
	</script>
	<script>
		var app = angular.module('myApp', []);
	   /*自定义过滤器   1*/
		app.filter("modify",function(){
			return function(input,param){
				if(param == 0){
					return param = "充值"
				}
				if(param == 1){
					return param = "支付"
				}
				if(param == 2){
					return param = "提现"
				}
				if(param == 3){
					return param = "退单"
				}
				input = param
				return input
			}
		})
		/*自定义过滤器   2*/
		app.filter("modify2",function(){
			return function(input,param){
				if(param == 0){
					return param = "待完成"
				}
				if(param == 1){
					return param = "成功"
				}
				if(param == 2){
					return param = "取消"
				}
				input = param
				return input
			}
		})
        app.controller('customersCtrl', function($scope, $http ){        	
        	/*用户分润明细*/
        	var phone = sessionStorage.getItem(key=2)
        	var token = sessionStorage.getItem(key=1)
        	console.log(token)
			$http({
				method:'POST',
			    /*params:{phone:13800000000},*/
				url:window.baseUrl+"transactionclear/profit/query/"+token,
			}).then(function successCallback(data){
				console.log("查询用户分润信息成功...")
				console.log(data)
				$scope.pages = data.data.result.numberOfElements
				console.log($scope.pages)
				if(data.data.result.length==0){
					$scope.items = ""
					alert("暂无数据")	
				}else{
					$scope.items = data.data.result.content
				}
			}, function errorCallback(data){
					console.log("查询用户分润信息失败...")
			     	console.log(data)
			});
        })
	</script>
</html>


